package xin.mashibo.wanjiobutest.vo;

import android.os.Parcel;
import android.os.Parcelable;

import com.wanji.etcble.bean.CardConsumeRecord;

/**
 * 卡片消费信息扩展类，便于在Bundle中传递
 *
 * @author MaShibo
 *         on 2018/3/21
 */
public class CardConsumeExtend extends CardConsumeRecord implements Parcelable {

    public CardConsumeExtend() {
    }


    public CardConsumeExtend(CardConsumeRecord record) {
        applicationId = record.getApplicationId();
        recordLength = record.getRecordLength();
        applicationLockFlag = record.getApplicationLockFlag();
        tollRoadNetworkId = record.getTollRoadNetworkId();
        tollStationId = record.getTollStationId();
        tollLaneId = record.getTollLaneId();
        timeUnix = record.getTimeUnix();
        vehicleModel = record.getVehicleModel();
        passStatus = record.getPassStatus();
        reserve1 = record.getReserve1();
        staffNo = record.getStaffNo();
        mtcSequenceNo = record.getMtcSequenceNo();
        vehicleNumber = record.getVehicleNumber();
        reserve2 = record.getReserve2();
    }


    protected CardConsumeExtend(Parcel in) {
        applicationId = in.readString();
        recordLength = in.readString();
        applicationLockFlag = in.readString();
        tollRoadNetworkId = in.readString();
        tollStationId = in.readString();
        tollLaneId = in.readString();
        timeUnix = in.readString();
        vehicleModel = in.readString();
        passStatus = in.readString();
        reserve1 = in.readString();
        staffNo = in.readString();
        mtcSequenceNo = in.readString();
        vehicleNumber = in.readString();
        reserve2 = in.readString();
    }

    public static final Creator<CardConsumeExtend> CREATOR = new Creator<CardConsumeExtend>() {
        @Override
        public CardConsumeExtend createFromParcel(Parcel in) {
            return new CardConsumeExtend(in);
        }

        @Override
        public CardConsumeExtend[] newArray(int size) {
            return new CardConsumeExtend[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(applicationId);
        dest.writeString(recordLength);
        dest.writeString(applicationLockFlag);
        dest.writeString(tollRoadNetworkId);
        dest.writeString(tollStationId);
        dest.writeString(tollLaneId);
        dest.writeString(timeUnix);
        dest.writeString(vehicleModel);
        dest.writeString(passStatus);
        dest.writeString(reserve1);
        dest.writeString(staffNo);
        dest.writeString(mtcSequenceNo);
        dest.writeString(vehicleNumber);
        dest.writeString(reserve2);
    }
}
